package it.patterns.behavioral.state;

/**
 * Allow an object to alter its behavior when its internal state changes. The
 * object will appear to change its class.
 * 
 * You can apply this pattern when an object behavior depends on its state, and
 * it must change its behavior at run-time depending on that state.<br/>
 * 
 * The Context (i.e. the primary interface for clients) delegates state-specific
 * requests to the current ConcreteState object (often Singleton). Moreover, a
 * Context may pass itself as an argument to the State object handling the
 * request. The client doens't have to deal with the State object directly.<br/>
 * 
 * Either Context or the ConcreteState subclasses can decide which state
 * succeeds another and under what circumstances.
 * 
 * <img src="State.jpg" alt="Pattern Structure"/>
 * 
 * @author Luca D'Onofrio
 * 
 * @category Behavioral Pattern
 * @see "Design Patterns - Element of Reusable Object Oriented Software (Gamma,Helm, Johnson, Vlissides)"
 * 
 * @version 1.0
 * 
 */
public abstract class State {
	protected Context context;

	public State(Context context) {
		super();
		this.context = context;
	}

	public abstract void handle();

}
